//@flow
import { AppLoginModal } from "./modal/requestParamsModal/appLoginModal";
// import request from "./request";
import { AppVersionInfoModal } from "./modal/responseModal/appVersionInfoModal";
import { ResponseBaseModal } from "./modal/baseModal/responseBaseModal";
import { Request } from "./request";
import { ResponseResultStatus } from "./business/ResponseResultStatus";
import * as Config from "../config/config";

/**获取广告文件数据 */
export function getADJsonData(params){
    
}

/**登陆接口 */
export function appLogin(params:AppLoginModal){
    // return request('https://www.baidu.com',{username:'linting',passowrd:'linting'},'post')
}

/**注册接口 */
export function appRegister(params:AppRegisterReqModal){}

/**重置密码 */
export function appResetPassword(params){}

/**修改密码 */
export function appUpdatePassword(params){}


/**获取app store版本信息 */
export async function queryAppStoreInfo():Promise<ResponseBaseModal>{
    let res:ResponseBaseModal  = new ResponseBaseModal(await Request.GET('https://itunes.apple.com/lookup',{id:Config.APP_ID_IN_STORE}))
    //这里因为响应的数据是其他服务器，所以单独特殊处理
    let obj : ResponseBaseModal ;
    if(res){
        obj = new ResponseBaseModal({code:ResponseResultStatus.Success,message:'请求成功',data:res.data})
    }else{
        obj = res;
    }
    console.log(obj)
    return obj
}